#include <iostream>

int main1();

int main2();

int main3();

using namespace std;
typedef struct Person {
    int a;
    int b;
    int a2;
    int b3;
    int a4;
    int b5;
    int a6;
    int b7;
    int a8;
    int b9;
} Person;

int main() {
    std::cout << "Hello, World!" << std::endl;
    main1();
    main3();
    string x = "xx";
    cout << (void *) x.c_str() << endl;
    cout << &x << endl;
    x = "xxx";
    cout << &x << endl;
    try {
        int i = 1;
        cout << "----1-" << endl;

        i = 1 / 0;
        throw "xxxx";
        cout << "--x---" << endl;

    } catch (...) {
        cout << "-----" << endl;
    }

    return 0;
}

int main3() {
    int *p = new int(2);
}

int main1() {
    Person person = {.a=3, .a4=4};
}

int main2() {
    int a = 2000;
    int x = sizeof(int);
    cout << sizeof(long) << endl;
    cout << sizeof(long long) << endl;
    int b = 2;
    int *p = &b;
    //指针常量
    const int *p2 = &b;
    *p = 3;
    p2 = &a;
    // *p2=4; 错误
    cout << b << endl;
    //常量指针
    int *const p3 = &b;
    *p3 = 5;
    //p3 = &a;  错误
    //常指针常量
    int const *const ccp = &a;
}

